<?php

/**
 * EmailCampaignUserPerformance form base class.
 *
 * @method EmailCampaignUserPerformance getObject() Returns the current form's model object
 *
 * @package    ecrm
 * @subpackage form
 * @author     Saul Santiago
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseEmailCampaignUserPerformanceForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                             => new sfWidgetFormInputHidden(),
      'email_campaign_user_details_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('EmailCampaignUserDetails'), 'add_empty' => true)),
      'selected'                       => new sfWidgetFormChoice(array('choices' => array('Yes' => 'Yes', 'No' => 'No'))),
      'hard_bounce'                    => new sfWidgetFormChoice(array('choices' => array('Yes' => 'Yes', 'No' => 'No'))),
      'soft_bounce'                    => new sfWidgetFormChoice(array('choices' => array('Yes' => 'Yes', 'No' => 'No'))),
      'received'                       => new sfWidgetFormChoice(array('choices' => array('Yes' => 'Yes', 'No' => 'No'))),
      'opened'                         => new sfWidgetFormChoice(array('choices' => array('Yes' => 'Yes', 'No' => 'No'))),
      'clicked'                        => new sfWidgetFormChoice(array('choices' => array('Yes' => 'Yes', 'No' => 'No'))),
      'unsubscribed'                   => new sfWidgetFormChoice(array('choices' => array('Yes' => 'Yes', 'No' => 'No'))),
      'complaint'                      => new sfWidgetFormChoice(array('choices' => array('Yes' => 'Yes', 'No' => 'No'))),
    ));

    $this->setValidators(array(
      'id'                             => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'email_campaign_user_details_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('EmailCampaignUserDetails'), 'required' => false)),
      'selected'                       => new sfValidatorChoice(array('choices' => array(0 => 'Yes', 1 => 'No'), 'required' => false)),
      'hard_bounce'                    => new sfValidatorChoice(array('choices' => array(0 => 'Yes', 1 => 'No'), 'required' => false)),
      'soft_bounce'                    => new sfValidatorChoice(array('choices' => array(0 => 'Yes', 1 => 'No'), 'required' => false)),
      'received'                       => new sfValidatorChoice(array('choices' => array(0 => 'Yes', 1 => 'No'), 'required' => false)),
      'opened'                         => new sfValidatorChoice(array('choices' => array(0 => 'Yes', 1 => 'No'), 'required' => false)),
      'clicked'                        => new sfValidatorChoice(array('choices' => array(0 => 'Yes', 1 => 'No'), 'required' => false)),
      'unsubscribed'                   => new sfValidatorChoice(array('choices' => array(0 => 'Yes', 1 => 'No'), 'required' => false)),
      'complaint'                      => new sfValidatorChoice(array('choices' => array(0 => 'Yes', 1 => 'No'), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('email_campaign_user_performance[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'EmailCampaignUserPerformance';
  }

}
